/*
 * =====================================================================================
 *
 *       Filename:  file_trans_redis.h
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  2013年06月17日 14时37分25秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Xie Yanping (), 
 *        Company:  www.Qihoo.net
 *
 * =====================================================================================
 */

#ifndef _IMSERVER_FILE_TRANSFER_FILETRANSREDIS_H_
#define _IMSERVER_FILE_TRANSFER_FILETRANSREDIS_H_

#include "FileTransfer_types.h"
#include <boost/scoped_ptr.hpp>

class RedisExecutor;

namespace imserver {

class FileTransRedis {
 public:
  static FileTransRedis& GetInst() {
    static FileTransRedis redis;
    return redis;
  }

  int GetFileContent(FileContent& content, const std::string& identify);
  int GetFileStream(std::string& body,
                    const std::string& identify,
                    const int64_t offset);
  int SetFileContent(const FileContent& content);
  int SetFileStream(const std::string& body, const std::string& identify);

 private:
  FileTransRedis();
  boost::scoped_ptr<RedisExecutor> redis_exec_;
};

}

#endif //_IMSERVER_FILE_TRANSFER_FILETRANSREDIS_H_
